<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="utf-8"/>
<title>Đăng ký</title>
<link rel="stylesheet" href="Css/cc.css"></link>
</head>
<body>
<div class="wrapper">
<?php include 'menu.php';?>
<div class="content">
    <?php
    if (isset($_POST['btnreg']))
    {
        $name =$con->real_escape_string($_POST["txtname"]);
        $last =$con->real_escape_string($_POST["txtlast"]);
        $fullname = $last." ".$name;
        $username =$con->real_escape_string($_POST["txtuser"]);
        $pass = md5($_POST["txtpass"]);
        $repass =$con->real_escape_string($_POST["txtrepass"]);
        $day = $_POST["Day"];
        $month = $_POST["Month"];
        $year = $_POST["Year"];
        $reg_result =$con->query("SELECT * FROM members where user = \"{$username}\"");
        if($reg_row = mysqli_fetch_array($reg_result))
        { ?>
    <div><br></br>Tài khoản đã tồn tại. Ấn vào <a href="javascript:history.go(-1)">đây</a> để trở lại.</div>
    <?php }
    else
        {
            if($reg_rusult=$con->query("Insert into members value('{$username}','{$pass}','','{$fullname}')"))
            {?>
                <div><br></br>Đăng ký thành công ấn vào <a href="login.php">đây</a> để đăng nhập.</div>
           <?php }
        }
        } ?>
</div>
<div class="footer">
We are... Mr.Chuot Tru, Mr.Minh Ho
<hr  width="20%" style="margin-left:40%; margin-top:8px;"/>
<pre><br /><br />
Coppyright: Aitieducation
</pre>
</div>
</div>
</div>
</body>
</html>